﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Pokemon_Battle_System.Controllers
{
    public class Pokemon
    {
        public Pokemon()
        {

        }

        //Attributes
        public string Name { get; set; }
        public string Details { get; set; }
        public PokemonTypes Type { get; set; }
        public PokemonTypes Weakness { get; set; }
        public PokemonTypes Resist { get; set; }
        public List<Attack> AttackList { get; set; }
        public int Attack { get; set; }
        public int Defense { get; set; }
        public int SpAttack { get; set; }
        public int SpDefense { get; set; }
        public int Agility { get; set; }
        public int Accuracy { get; set; }

        /// <summary>
        /// Loads all the Pokemon Attacks from the Database to the AttackList
        /// </summary>
        private void LoadAttacks()
        {

        }

        /// <summary>
        /// You pass in the Attack that was choosen by the user and the Attack method will get what damage was cause, to what, and what status effect it did
        /// </summary>
        /// <param name="choosenAttack"></param>
        /// <returns></returns>
        public AttackResults Attack(Attack choosenAttack)
        {
            AttackResults ar = new AttackResults();
            ar.AttackName = choosenAttack.Name;
            ar.Damage = DetermineDamage(choosenAttack.MinDamage, choosenAttack.MaxDamage);
            ar.DamageType = choosenAttack.DamageType;
            ar.Effect = choosenAttack.Effect;
            ar.AttackType = choosenAttack.Type;
            return ar;
        }

        private int DetermineDamage(int min, int max)
        {
            Random rand = new Random();
            return rand.Next(min, max);
        }
    }

    public enum PokemonTypes
    {
        Fire,
        Water,
        Grass,
        Electric,
        Rock,
        Fighting,
        Normal,
        Flying,
        Psychic,
        Poison,
        Ghost,
        Dark,
        Steel,
        Bug
    };

    public enum Status
    {
        Sleep,
        Poison,
        Confused,
        Paralyzed,
        None
    };
}